package com.aaa.hospital.controller;

import com.aaa.hospital.pojo.domain.Signin;
import com.aaa.hospital.pojo.query.JianyiQuery;
import com.aaa.hospital.pojo.query.PatientQuery;
import com.aaa.hospital.pojo.query.YuyueQuery;
import com.aaa.hospital.pojo.vo.AddProposal;
import com.aaa.hospital.pojo.vo.PatientVo;
import com.aaa.hospital.result.AjaxResult;
import com.aaa.hospital.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author:张海金
 * Description:TODO
 * DateTime:2022/1/15 19:03
 */
@RestController
@RequestMapping("patient")
public class PatientController {

    @Autowired
    private PatientService patientService;

    @RequestMapping("query")
    public AjaxResult query(PatientQuery query){
        return patientService.queryPatient(query);
    }

    @RequestMapping("get/{id}")
    public AjaxResult add(@PathVariable("id") Integer id){
        return patientService.get(id);
    }
    @RequestMapping("setrefuse/{id}")
    public AjaxResult setrefuse(@PathVariable("id") Integer id){
        return patientService.setrefuse(id);
    }

    @RequestMapping("list")
    public AjaxResult list(YuyueQuery yuyueQuery){
        return patientService.list(yuyueQuery);
    }

    @RequestMapping("query/{id}")
    public AjaxResult query(@PathVariable("id") Integer id){
        return patientService.query(id);
    }

    @RequestMapping("add")
    public AjaxResult add(AddProposal proposal){
        // System.out.println("打印结果=====》》》" + proposal + "《《《=====");
        return patientService.add(proposal);
    }

    @RequestMapping("queryAll")
    public AjaxResult queryAll(JianyiQuery patient){
        return patientService.queryAll(patient);
    }


    @RequestMapping("update/{id}")
    public AjaxResult update(@PathVariable("id") Integer id){
         System.out.println("打印结果=====》》》" + id + "《《《=====");
        return null;
    }
    @RequestMapping("remove/{id}")
    public AjaxResult delete(@PathVariable("id") Integer id){
        return patientService.remove(id);
    }
    @RequestMapping("getResult")
    public AjaxResult getResult(String a){
        return patientService.getResult(a);
    }

    @RequestMapping("getProposal")
    public AjaxResult getProposal(String name){
        return patientService.getProposal(name);
    }

}
